﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pai.LiveStation
{
    public class RadioPlayer : PlayerBase<AuditoryMediaBase>
    {

        public RadioPlayer(RadioStation mediahub) : base(mediahub)
        {
       
        }

        public RadioPlayer(RadioStation mediahub, IPlaylist<AuditoryMediaBase> userplaylist) : this(mediahub)
        {
            SetPlaylist(userplaylist);
        }

        public RadioPlayer(RadioStation mediahub, IPlaylist<AuditoryMediaBase> userplaylist, string name) : this(mediahub, userplaylist)
        {
            Name = name;
        }

        public override bool SetHub(MediaHubBase mediahub)
        {
            if (!base.SetHub(mediahub))
                return false;

            DownloadMedia();

            return true;
        }

        public override bool SetPlaylist(IPlaylist<AuditoryMediaBase> userplaylist)
        {
            if (userplaylist == null || isPlaying)
                return false;

            //unload media

            //..
            playlist = userplaylist;
            return true;
        }

        

    }
}
